package kayao.server.network.message;

import kayao.common.KayaoValues;
import kayao.common.NetworkUtils;

public class TimeMessage extends Message {

	protected TimeMessage(String targetAddress) {
		super(targetAddress, 2, 2, 0);
		createPacketData();
	}

	@Override
	public void createPacketData() {
		mSendData = new byte[5];
		mSendData[0] = KayaoValues.TIME_IS_MESSAGE;
		int uptime = (int) (System.currentTimeMillis()-KayaoValues.SERVER_START.getTime());
		NetworkUtils.insertIntToByteArray(mSendData, 1, uptime);
		
	}

	@Override
	public String type() {
		// TODO Auto-generated method stub
		return "Time";
	}

}
